<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>组件-局部注册</title>
</head>
<body>
<div id="app">
    <component-b></component-b>

</div>

<script src="node_modules/vue/dist/vue.js"></script>
<script>
    new Vue({
        el: "#app",
        //局部组件
        components: {
            'component-b': {
                template: '<div> 这是：{{ name }}</div>',
                data() {
                    return {
                        name: "局部组件"
                    };
                }
            }
        }
    });
</script>
</body>
</html>
